package com.hisense.ovcloud.ps.config;

import com.hisense.ovcloud.commons.configs.validator.BaseValidator;
import com.hisense.ovcloud.ps.dto.req.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.validation.Validator;

import java.util.List;

@Configuration
@Order(-999)
public class ValidatorsConfig {

    @Bean
    @Qualifier("certifyReqValidator")
    public Validator certifyReqValidator(){
        return new BaseValidator(CertifyReq.class, List.of("wifiId"));
    }

    @Bean
    @Qualifier("verifyReqValidator")
    public Validator verifyReqValidator(){
        return new BaseValidator(VerifyReq.class, List.of("token"));
    }

    @Bean
    @Qualifier("wifiOnlineReqValidator")
    public Validator wifiOnlineReqValidator(){
        return new BaseValidator(WifiOnlineReq.class, List.of("wifiId"));
    }

    @Bean
    @Qualifier("getWifiStatReqValidator")
    public Validator getWifiStatReqValidator(){
        return new BaseValidator(GetWifiStatReq.class, List.of("wifiId"));
    }

    @Bean
    @Qualifier("getWifiListStatReqValidator")
    public Validator getWifiListStatReqValidator(){
        return new BaseValidator(GetWifiListStatReq.class, List.of("wifiList"));
    }
}
